/* ===== 布局框架 ===== */
.iphone-frame {
  width: 100vw;
  height: 100vh;
  border-radius: 0;
  overflow: hidden;
  background-color: #1a1a1a;
  color: #fff;
  margin: 0;
  display: flex;
  flex-direction: column;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* 白天主题 */
.light-theme {
  background-color: #f5f5f5;
  color: #333;
}

/* ===== 导航栏 ===== */
.nav-bar {
  position: relative;
  width: 100%;
  border-bottom: 1upx solid rgba(255, 255, 255, 0.1);
}

/* 顶部安全区域，适配刘海屏 */
.safe-top {
  /* 优先使用环境变量 */
  height: calc(var(--status-bar-height, 0px) + env(safe-area-inset-top, 0px));
  /* 为不支持上述变量的环境提供默认高度 */
  min-height: 44px;
  width: 100%;
  background-color: #1a1a1a; /* 保持与导航栏背景一致 */
}

.light-theme .safe-top {
  background-color: #1a1a1a; /* 从#f5f5f5修改为深色，与夜间模式保持一致 */
}

.light-theme .nav-bar {
  border-bottom: 1upx solid rgba(0, 0, 0, 0.1);
}

.nav-content {
  height: 44px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  padding: 0 40upx;
}

.nav-center {
  display: flex;
  align-items: center;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.nav-left {
  display: flex;
  align-items: center;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 16upx;
}

/* 主题切换按钮 */
.theme-toggle {
  display: flex;
  align-items: center;
  padding: 4upx 12upx;
  border-radius: 16upx;
  background-color: transparent; /* 将深色主题背景改为透明 */
}

.light-theme .theme-toggle {
  background-color: transparent !important; /* 将浅色主题背景改为透明 */
}

.light-theme .theme-toggle {
  background-color: rgba(0, 0, 0, 0.1);
}

/* ===== 主体 ===== */
.content {
  flex: 1;
  box-sizing: border-box;
  background-color: #1a1a1a;
  transition: background-color 0.3s ease;
  overflow-y: auto; /* 添加此属性以确保内容超出时可以滚动 */
  height: 0; /* 这是一个技巧，可以确保flex子元素正确计算高度并允许滚动 */
}

.light-theme .content {
  background-color: #f5f5f5;
}

.section {
  padding: 40upx 40upx;
}

/* 大标题区域 */
.section-header {
  margin-bottom: 48upx;
  text-align: center;
  animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-20upx);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: center; /* 新增：使标题内容居中 */
  font-size: 48upx; /* 从38upx增大到48upx */
  font-weight: bold;
  color: #fff;
  position: relative;
}

.light-theme .section-title {
  color: #333;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -10upx;
  left: 52upx;
  width: calc(100% - 52upx);
  height: 8upx;
  background: linear-gradient(90deg, #4caf50, #8bc34a);
  border-radius: 5upx;
}

/* 短下划线样式 */
.section-title.short-underline::after {
  bottom: -32upx; /* 增加下划线与文字的距离（从-24upx改为-32upx） */
  width: calc((100% - 52upx) / 8); /* 从/4修改为/8，使横线宽度变为原来的一半 */
  left: 50%; /* 修改为居中对齐 */
  transform: translateX(-50%); /* 调整位置使下划线完全居中 */
}
.section-subtitle {
  font-size: 28upx; /* 从24upx增大到28upx */
  color: #999;
  margin-top: 48upx; /* 上边距从24upx增加到48upx，增加一倍 */
}

.light-theme .section-subtitle {
  color: #666;
}

/* 分组区域 */
.group {
  margin-bottom: 64upx;
  position: relative;
}

/* 显示左侧的装饰线条，并为不同类型的分组设置不同颜色 */
.group-decoration {
  position: absolute;
  top: 28upx;
  left: 0;
  width: 8upx;
  height: 32upx;
  border-radius: 4upx;
  transition: background-color 0.3s ease;
  transform: translateY(-50%);
}

/* 蔬菜分组 - 绿色线条 */
.vegetable-group .group-decoration {
  background-color: #4caf50;
}

/* 肉类分组 - 红色线条 */
.meat-group .group-decoration {
  background-color: #f44336;
}

/* 主食分组 - 橙色线条 */
.staple-group .group-decoration {
  background-color: #ff9800;
}

/* 厨具分组 - 蓝色线条 */
.tool-group .group-decoration {
  background-color: #2196f3;
}

/* 白天主题下的不同颜色线条 */
.light-theme .vegetable-group .group-decoration {
  background-color: #8bc34a;
}

.light-theme .meat-group .group-decoration {
  background-color: #ff5722;
}

.light-theme .staple-group .group-decoration {
  background-color: #ffc107;
}

.light-theme .tool-group .group-decoration {
  background-color: #64b5f6;
}

/* 修改标题样式，使其左侧对齐 */
.group-title {
  display: flex;
  align-items: center;
  margin-bottom: 24upx;
  padding-left: 24upx;
  font-size: 42upx; /* 从36upx增大到42upx */
  font-weight: 500;
  color: #ccc;
  transition: all 0.3s ease;
}

.group-title:active {
  transform: translateX(4upx);
}

.light-theme .group-title {
  color: #666;
}

/* 恢复标签列表的左侧对齐 */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 16upx;
  padding-left: 24upx;
}

/* ===== 标签 ===== */
.tag {
  padding: 8upx 24upx;
  border-radius: 999upx;
  font-size: 28upx; /* 从24upx增大到28upx */
  display: flex;
  align-items: center;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.tag-active {
  background-color: #4caf50;
  color: #fff;
}

.tag-inactive {
  background-color: rgba(76, 175, 80, 0.1);
  color: #8bc34a;
}

.meat-tag-active {
  background-color: #f44336;
  color: #fff;
}

.meat-tag-inactive {
  background-color: rgba(244, 67, 54, 0.1);
  color: #ffcdd2;
}

.staple-tag-active {
  background-color: #ff9800;
  color: #fff;
}

.staple-tag-inactive {
  background-color: rgba(255, 152, 0, 0.1);
  color: #ffe0b2;
}

.tool-tag-active {
  background-color: #2196f3;
  color: #fff;
}

.tool-tag-inactive {
  background-color: rgba(33, 150, 243, 0.1);
  color: #90caf9;
}

/* 白天主题下的标签样式 */
.light-theme .tag-active,
.light-theme .meat-tag-active,
.light-theme .staple-tag-active,
.light-theme .tool-tag-active {
  color: #fff;
}

.light-theme .tag-inactive,
.light-theme .meat-tag-inactive,
.light-theme .staple-tag-inactive,
.light-theme .tool-tag-inactive {
  color: #666;
  background-color: rgba(0, 0, 0, 0.05);
}

/* ===== 菜谱结果 ===== */
.recipe-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12upx;
  margin-top: 78upx; /* 已有的上边距 */
  margin-bottom: 56upx; /* 添加下边距为56upx */
  justify-content: center;
  align-items: center;
  min-height: 120upx;
}

/* ===== 统一空菜谱消息的主题样式 ===== */
.empty-recipe-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40upx;
  /* 移除通用背景色设置，让主题样式决定 */

}

/* 白天主题样式 - 取消白色背景 */
.light-theme .empty-recipe-message {
  color: #666;
  background-color: transparent; /* 设置为透明背景 */
  box-shadow: none; /* 移除阴影 */
}

/* 黑夜主题样式 - 也使用透明背景保持一致性 */
.dark-theme .empty-recipe-message {
  color: #aaa;
  background-color: transparent;
  box-shadow: none;
}

/* 图片样式 */
.image-icon-more {
  width: 180upx;
  height: 180upx;
  margin-bottom: 24upx;
  border-radius: 20upx;
  transition: transform 0.3s ease;
}

/* 文字样式 */
.empty-recipe-message text {
  font-size: 36upx;
  font-weight: 500;
  text-align: center;
  font-size: 26upx;
  line-height: 1.5;
}

/* 悬停效果 */
.empty-recipe-message:hover .image-icon-more {
  transform: scale(1.05);
}

/* 适配不同屏幕尺寸 */
@media screen and (max-width: 375px) {
  .empty-recipe-message {
    width: 90%;
    padding: 40upx 30upx;
  }
  
  .image-icon-more {
    width: 150upx;
    height: 150upx;
  }
}

.recipe-tag {
  padding: 8upx 16upx; /* 增加内边距以适应更大的文字 */
  background-color: rgba(255, 255, 255, 0.05);
  border: 1upx solid rgba(255, 255, 255, 0.1);
  border-radius: 8upx;
  font-size: 28upx; /* 从24upx增大到28upx */
  display: flex;
  align-items: center;
  color: #fff;
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

.light-theme .recipe-tag {
  background-color: rgba(0, 0, 0, 0.05);
  border: 1upx solid rgba(0, 0, 0, 0.1);
  color: #333;
}

/* ===== 图标样式 ===== */
/* 移除原有的通用图标占位样式 */

/* 图片图标样式 */
.image-icon {
  width: 40upx;
  height: 40upx;
  margin-right: 8upx;
  /* 移除圆角样式 */
}

.image-icon-small {
  width: 32upx;
  height: 32upx;
  margin-right: 8upx;
  /* 移除圆角样式 */
}

.image-icon-small-end {
  margin-right: unset;
}

.image-icon-more {
  width: 160upx;
  height: 160upx;
}

.close-icon {
  width: 32upx;
  height: 32upx;
  margin-left: 8upx;
  margin-right: 0;
  background-color: transparent;
}

/* 匹配模式选择样式 */
.match-mode-section {
  margin-top: 10px;
  padding: 10px;
}

.mode-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.mode-button {
  padding: 8px 16px;
  border-radius: 16px;
  background-color: #f0f0f0;
  color: #333;
  font-size: 14px;
  text-align: center;
}

.mode-button-active {
  background-color: #4cd964;
  color: white;
}

/* 深色主题适配 */
.light-theme .match-mode-section {
  background-color: #f5f5f5; /* 从#ffffff修改为主题色，与白天主题背景保持一致 */
}

.light-theme .mode-button {
  background-color: #f0f0f0;
  color: #333;
}

.light-theme .mode-button-active {
  background-color: #4cd964;
  color: white;
}
/* 主题切换图标样式 */
.theme-icon-image {
  width: 40upx; /* 根据需要调整大小 */
  height: 40upx;
}

/* ===== 扇形菜单样式 ===== */
.fan-menu {
  position: fixed;
  bottom: 160upx; /* 已调整过的位置 */
  right: 40upx;
  z-index: 999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* 主按钮样式 - 移除背景颜色 */
.fan-main-button {
  width: 100upx;
  height: 100upx;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.1); /* 黑夜模式下的磨砂白色透明背景 */
  backdrop-filter: blur(10px); /* 实现磨砂效果 */
  -webkit-backdrop-filter: blur(10px); /* 兼容webkit内核 */
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4upx 20upx rgba(0, 0, 0, 0.3); /* 调整阴影以适应透明背景 */
  transition: all 0.3s ease;
  transform-origin: center;
}

/* 主按钮打开状态 - 同样设置磨砂背景 */
.fan-main-button.open {
  background-color: rgba(255, 255, 255, 0.1); /* 黑夜模式下的磨砂白色透明背景 */
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transform: rotate(45deg);
}

/* 白天主题下的主按钮 */
.light-theme .fan-main-button {
  background-color: transparent;
  box-shadow: 0 4upx 20upx rgba(0, 0, 0, 0.3); /* 调整白天主题的阴影 */
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.light-theme .fan-main-button.open {
  background-color: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* 子按钮样式 - 根据实际情况调整 */
.fan-sub-button {
  position: absolute;
  width: 80upx;
  height: 80upx;
  border-radius: 50%;
  background-color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2upx 10upx rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  opacity: 0;
  transform: scale(0.5);
  z-index: -1;
}

.light-theme .fan-sub-button {
  background-color: #ffffff;
}

/* 子按钮打开状态 */
.fan-sub-button.open {
  opacity: 1;
  transform: scale(1);
  z-index: 1;
}

/* 子按钮位置 */
.fan-sub-button-1 {
  transform-origin: center 180upx;
  transition-delay: 0.05s;
}

.fan-sub-button-1.open {
  transform: translate(0, -140upx);
}

.fan-sub-button-2 {
  transform-origin: center 180upx;
  transition-delay: 0.1s;
}

.fan-sub-button-2.open {
  transform: translate(-93upx, -93upx);
}

.fan-sub-button-3 {
  transform-origin: center 180upx;
  transition-delay: 0.15s;
}

.fan-sub-button-3.open {
  transform: translate(-140upx, 0);
}

/* 图标样式 */
.fan-button-icon {
  width: 48upx;
  height: 48upx;
}

/* 点击反馈效果 - 调整主按钮的点击效果 */
.fan-main-button:active {
  transform: scale(0.95) rotate(45deg);
}

.fan-sub-button:active {
  transform: scale(0.9);
}

.fan-sub-button-1.open:active {
  transform: translate(0, -140upx) scale(0.9);
}

.fan-sub-button-2.open:active {
  transform: translate(-93upx, -93upx) scale(0.9);
}

.fan-sub-button-3.open:active {
  transform: translate(-140upx, 0) scale(0.9);
}